import { Controller, Get, Param } from '@nestjs/common';
import { AlbumService } from '../service/album.service';
import { AlbumDto } from '../dto/album.dto';

@Controller('albums')
export class AlbumController {
  constructor(private readonly albumService: AlbumService) {}

  @Get()
  findAll(): AlbumDto[] {
    return this.albumService.findAll();
  }

  @Get(':id')
  findOne(@Param('id') id: string): AlbumDto | string {
    return this.albumService.findOne(parseInt(id, 10));
  }
}